class Solution(object):
    def longestConsecutive(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        max_num = 0
        pointer1 = 0
        while pointer1 < len(nums):
            if nums[pointer1] - 1 not in nums:
                pointer2_num = nums[pointer1]
                this_len = 1
                while pointer2_num + 1 in nums:
                    pointer2_num += 1
                    this_len += 1
                # print(this_len)
                max_num = max(max_num, this_len)
            pointer1 += 1
        return max_num


solution = Solution()
solution.longestConsecutive([100,4,200,1,3,2])

